import React from 'react';
import PropTypes from 'prop-types';
import './index.scss';

// 我的相册列表
class ListItem extends React.Component {
  constructor(props) {
    super(props);
    this.state = {

    }
    this.handleItemClick = this.handleItemClick.bind(this)
  }
  handleItemClick() {
    this.props.itemClick(this.props.data);
  }
  render() {
    const { data } = this.props
    return (
      <li className="list-pic-item" onClick={this.handleItemClick}>
        <div className="pic-box">
          <img src={data.litpic} alt={data.title.render} />
        </div>
        <span className="img-title">
          {data.title.rendered}
        </span>
      </li>
    )
  }
}
export default ListItem;
ListItem.propTypes = {
  itemClick: PropTypes.func,
  data: PropTypes.objectOf(Object),
}
